It's unhelpful to flush all of them when we only need one.
Reported-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
volatile struct nestedvcpu *nv = &vcpu_nestedhvm(v);
struct domain *d;
struct p2m_domain *p2m;
- int i;
/* Mask out low bits; this avoids collisions with CR3_EADDR */
cr3 &= ~(0xfffull);
}
/* All p2m's are or were in use. Take the least recent used one,
- * flush it and reuse.
- */
- for (i = 0; i < MAX_NESTEDP2M; i++) {
- p2m = p2m_getlru_nestedp2m(d, NULL);
- p2m_flush_locked(p2m);
- }
+ * flush it and reuse. */
+ p2m = p2m_getlru_nestedp2m(d, NULL);
+ p2m_flush_locked(p2m);
nv->nv_p2m = p2m;
p2m->cr3 = cr3;
nv->nv_flushp2m = 0;